#ifndef _DRIVER_H_
#define _DRIVER_H_

#pragma once

#ifdef __cplusplus
extern "C"
{
#endif
	
#include <ntddk.h>
	
#ifdef __cplusplus
}
#endif

#define PAGEDCODE	code_seg("PAGE")
#define LOCKEDCODE	code_seg()
#define INITCODE	code_seg("INIT")

#define	PAGEDDATA	data_seg("PAGE")
#define LOCKEDDATA	data_seg()
#define	INITDATA	data_seg("INIT")

#define arraysize(p)	(sizeof(p)/sizeof(p[0]))
#define PDEO PDEVICE_OBJECT
#define PDRO PDRIVER_OBJECT

#define PDRO	PDRIVER_OBJECT
#define PDEO	PDEVICE_OBJECT
#define PDEX	PDEVICE_EXTENSION

typedef struct _DEVICE_EXTENSION{
	PDEVICE_OBJECT	pDevice;
	UNICODE_STRING	ustrDeviceName;
	UNICODE_STRING	ustrSymLinkName;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;

NTSTATUS CreateDevice(
	IN PDRIVER_OBJECT pDriverObject
	);

VOID HelloDDKUnLoad(
	IN PDRIVER_OBJECT pDriverObject
	);

NTSTATUS HelloDDKDispatchRoutine(
	IN PDEVICE_OBJECT pDevObj,
	IN PIRP	pIrp
	);

NTSTATUS DirectIORead(
	IN PDEO pDevObj, 
	IN PIRP pIrp
	);

NTSTATUS DefaultDispatchRoutine(
	IN PDEO pDevObj, 
	IN PIRP pIrp
	);
#endif